/********************************************************************************
 *      Copyright:  (C) 2023 LingYun IoT System Studio
 *                  All rights reserved.
 *
 *       Filename:  led.h
 *    Description:  This head file head of led.c.
 *
 *        Version:  1.0.0(2023年07月11日)
 *         Author:  Ling Yun <lingyun@email.com>
 *      ChangeLog:  1, Release initial version on "2023年07月11日 13时51分58秒"
 *                 
 ********************************************************************************/

#ifndef __LED_H__
#define __LED_H__

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <linux/types.h>
#include <string.h>
#include <gpiod.h>

#define	LED_ON 		1
#define	LED_OFF 	0
#define	LED_OFFSET	10

struct gpiod_chip *chip;
struct gpiod_line *line_led;

int led_init(unsigned char gpio_chip, unsigned char gpio_offset);
int led_control(unsigned char cmd);
int led_release(void);

#endif
